local game = require "club.threecard.baccarat"
local Vector3 = CS.UnityEngine.Vector3

local config = game.pokerlib.core.poker_container_config.new()

config.show_hand = true;
config.ope_valid = false;

config.hand_poker_class = game.require "poker_controller.poker"

--就3张牌 写死就好了
config.hand_align = function(pokers, root)
    for i, poker in ipairs(pokers) do
        local x = 0
        local y = 0
        if i == 1 then
            x = 0
            y = 0
        elseif i == 2 then
            x = 173
            y = 0
        else
            x = 86.5
            y = -224
        end

        local pos = Vector3(x, y, 0)
        poker:set_parent(root)
        poker:set_position(pos)
    end
end

local empty_poker_data = config.poker_data_class.new(-1);

config.mopai_anim = function(poker_container, serverValueTable, over_handler)
    local empty_serverValueTable = {};
    for i = 1, #serverValueTable do
        table.insert(empty_serverValueTable, -1);
    end

    poker_container:insert_hand(empty_serverValueTable);

    local count = 0;
    for i = #poker_container.hand, #poker_container.hand - #empty_serverValueTable+1, -1 do
        local poker = poker_container.hand[i];
        poker:flip(config.poker_data_class.new(serverValueTable[#serverValueTable-count]));
        count = count + 1;
    end
end

return config